<template>
    <div style="background:rgb(67,67,67)" class="f-color-white flex row-around p40">
        <div class="ui-center-width flex row-around">
            <div v-for="(item,i) in datalist" :key="item.title" class="grey-box">
                <img v-if="i==0" src="~@/icons/home-item1.png" class="item-img">
                <img v-if="i==1" src="~@/icons/home-item2.png" class="item-img">
                <img v-if="i==2" src="~@/icons/home-item3.png" class="item-img">
                <img v-if="i==3" src="~@/icons/home-item4.png" class="item-img">
                <img v-if="i==4" src="~@/icons/home-item5.png" class="item-img">
                <img v-if="i==5" src="~@/icons/home-item6.png" class="item-img">
                <div class="f16">{{item.value}}{{item.unit}}</div>
                <div class="f12">{{item.title}}</div>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                datalist:[
                    {title:'测评支持',unit:'项',value:0, key:"companyamount"},
                    {title:'测评公司',unit:'家',value:0, key:"gameamount"},
                    {title:'入驻公司',unit:'家',value:0, key:"nodeamount"},
                    {title:'原创视频',unit:'部',value:0, key:"postamount"},
                    {title:'原创文章',unit:'篇',value:0, key:"recordamount"},
                    {title:'彩金',unit:'个',value:0, key:"videoamount"},
                ],
            }
        },
        mounted(){
            this.$http.get('index.php?g=home&m=Index&a=countindex', {
                params:{
                    
                }
            })
            .then(({data})=>{
                // console.log('统计区域',data)
                if (data.code==1) {
                    this.datalist.forEach((item)=>{
                        item.value = data.data[item.key]
                    })
                }
            })
        },
    }
</script>
